<template>
  <div v-for="(item, index) in config" :key="index">
    <!-- Input type -->
    <el-form-item :label="item.label" v-if="item.type === 'input'">
      <el-input
        v-model="data[item.param]"
        :placeholder="`请输入${item.param}`"
      ></el-input>
    </el-form-item>

    <!-- Radio type with ra-dict component -->
    <el-form-item :label="item.label" v-else-if="item.type === 'radio'">
      <ra-dict-select
        v-model="data[item.param]"
        :code="item.source"
        type="radio"
      ></ra-dict-select>
    </el-form-item>
  </div>
</template>

<script>
export default defineComponent({
  props: {
    config: {
      type: Array,
      required: true,
    },
    data: {
      type: Object,
      required: true,
    },
  },
});
</script>

<style scoped>
/* 添加样式 */
</style>
